// src/types/User.ts

// 通用参数响应
export interface Response {
  success: boolean
  code: string
  message: string
  data: object
}

// 分页查询用户列表
export interface GetUserPagedListAsync {
  account: string
  realname: string
  email: string
  phone: string
  status: number | ''
  pageIndex: number
  pageSize: number
}

// 用户数据类型
export interface User {
  id: number
  userCode: string // 用户编码
  account: string
  realname: string
  email: string | null
  phone: string | null
  status: 1 | 0 // 状态：0-禁用，1-启用
  departmentName: string // 部门名称
  departmentId?: number // 部门ID
  avatarUrl?: string // 头像URL
  createTime?: string
  updateTime?: string
}

// 分页查询用户列表响应
export interface GetUserPagedListAsyncResponse {
  code: string
  data: {
    pageIndex: number
    pageSize: number
    totalCount: number
    totalPages: number
    data: User[]
    hasPrevious: boolean
    hasNext: boolean
  }
  message: string
  success: boolean
}

// 添加用户参数
export interface AddUserAsyncParams {
  account: string
  password: string
  realname: string
}

// 修改用户参数
export interface UpdateUserAsyncParams {
  id: number
  userCode: string
  account: string
  password?: string
  realname: string
  phone?: string
  email?: string
  status: number
  department?: number // 部门
  avatarUrl?: string
}

//修改密码参数
export interface UpdateUserPwdAsyncParams {
  id: number
  password: string
  newPassword: string
}
